package com.snailct.bpp.service.client.support;

import com.snailct.bpp.commons.protocol.RespResult;
import com.snailct.bpp.service.client.ClientException;
import com.snailct.bpp.service.client.IServiceInvoker;
import com.snailct.bpp.commons.exception.ErrorCode;
import com.snailct.bpp.commons.protocol.WSProtocolHolder;
import com.snailct.bpp.commons.utils.JsonUtils;
import com.snailct.bpp.commons.utils.PropertiesUtil;
import net.sf.json.JSONObject;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.io.ByteArrayInputStream;
import java.util.Map;


/**
 * web service invoker
 * Created by huangxa on 2016/6/19.
 */
public class WSServiceInvoker extends DefaultServiceInvoker implements IServiceInvoker {
    private static final Log logger = LogFactory.getLog(WSServiceInvoker.class);
    protected RespResult request(String reqXml) {
        Object[] responses = WSProtocolHolder.getInstance().request(this.getReqURL(),"acceptRequest",reqXml,"http://SOAPlatform");
        if(responses[0]==null){
            logger.error("remote invoke failure!");
            return new RespResult(RespResult.ReqStatus.FAILURE,"");
        }
        return new RespResult(RespResult.ReqStatus.OK,null);
    }

}
